package net.starwifi.duobao.repository;

import net.starwifi.duobao.entity.Gglhd;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.util.List;

/**
 * Created by Administrator on 2015/11/24.
 */
public interface GglhdRepository extends Repository<Gglhd,Long> {

    @Modifying
    @Query(value = "select o from net.starwifi.duobao.entity.Gglhd o where o.type=?2 and o.status=?1")
    public List<Gglhd>  findByStatus(int status,int type);
    @Modifying
    @Query(value = "update net.starwifi.duobao.entity.Gglhd o set o.status=?2 where o.id=?1")
    public int OnGgl(Long id,int status);
    @Modifying
    @Query(value = "update net.starwifi.duobao.entity.Gglhd o set o.status=?2 where o.id=?1")
    public int OffGgl(Long id,int status);

}
